package canss.webservice.controls;

import org.apache.beehive.controls.api.bean.Control;
import org.apache.beehive.controls.api.bean.ControlImplementation;

import canss.webservice.model.PersonDesc;

import weblogic.jdbc.SQLExceptionWrapper;

import java.io.Serializable;

@ControlImplementation
public class PersonDescControlImpl implements PersonDescControl, Serializable
{
	private static final long serialVersionUID = 4005276916439057087L;
	@Control
	private BusinessSystemDB businesssystemDB;
	
	public Boolean checkPersonDesc(String _tblPID_pid) throws SQLExceptionWrapper
	{
		int ret = businesssystemDB.checkPersonDesc(_tblPID_pid);
		return ret>0;
	}
	
	public Boolean removePersonDesc(String _tblPID_pid) throws SQLExceptionWrapper
	{
		int ret = businesssystemDB.removePersonDesc(_tblPID_pid);
		return ret>0;
	}
	
	public Boolean addPersonDesc(String _tblPID_pid, Integer _pub_biztype) throws SQLExceptionWrapper
	{
		int ret = businesssystemDB.addPersonDesc(_tblPID_pid, _pub_biztype);
		return ret>0;
	}
	
	public Boolean updatePersonDesc(String _tblPID_pid, String _pub_name, String _pub_regnum, String _pub_category, String _pub_people, String _pub_money, String _pub_year, String _pub_ceo, String _pub_ceophone, String _pub_addr) throws SQLExceptionWrapper
	{
		int ret = businesssystemDB.updatePersonDesc(_tblPID_pid, _pub_name, _pub_regnum, _pub_category, _pub_people, _pub_money, _pub_year, _pub_ceo, _pub_ceophone, _pub_addr);
		return ret>0;
	}
	
	public PersonDesc[] getPersonDescByPID(String _tblPID_pid) throws SQLExceptionWrapper
	{
		PersonDesc[] retlist = businesssystemDB.getPersonDescByPID(_tblPID_pid);
		return retlist;
	}
	
	public PersonDesc[] getEntirePersonDesc() throws SQLExceptionWrapper
	{
		PersonDesc[] retlist = businesssystemDB.getEntirePersonDesc();
		return retlist;
	}
}